<?php
if (!$strScreenName)
	$strScreenName = 'welcome';

if($strStyleSheet == TRUE)
	echo "<div id='VendereScreen'>
			<table class='Normal' border='0' align='left' width='500'>";
$txtUserName = null;
$txtPassword = null;
if(isset($_REQUEST['boReprocessing']))
	$txtUserName = cleanFormInput($_REQUEST['txtUserName']);

?>
<tr valign='top'>
	<td>		  
	<?php print(StartForm($strScreenName, "post", "actProcessLogin",array('boReprocessing'=>true,'strScreenName'=>$strScreenName),"","","frmLogin","","return frmLogin_onsubmit()"));?>
		
		<?php
		if($SCREEN != "scrCheckout"){
		echo "
		<table width='100%' class='Normal' border='0'>
			<tr>
				<td colspan='2'>
					
					<b>New Customers</b>
					<p>If you have not registered with us yet then please <a href='".ScreenURL("EnterCustomer",array('strScreenName'=>$strScreenName))."'><u>register here</u></a>.</p>
					<hr />
				</td>
			
			</tr>

		</table>
		";
		}
		?>
		
		
		<table width='100%' class='Normal' border='0' align='left'>
			<tr align='left'>
				<td width='100%' height='2' colspan='2'><img src='./images/space.gif' height='2' border='0' alt='' /></td>
			</tr>
				
			<?php
			if($SCREEN == "scrCheckout"){
			?>
			<tr align='left'>
				<td colspan='2' align='left'>
					<h3>Existing Customers Login</h3><br />
					
				</td>
			</tr>
			
			<?php
			}else{
			?>
			<tr align='left'>
				<td colspan='2'>
					<b>Existing Customers Login</b><br />
					<p align='justify'>To log on to <?php echo SITE_NAME;?><br />simply enter the email address and password 
					that you registered with. Once you have logged in you will be able to make 
					purchases from our online shop.</p>
					<br />
					If you have not registered with us yet then please <a href='<? echo ScreenURL("EnterCustomer",array('strScreenName'=>$strScreenName)) ?>'>register here</a>.
				</td>
			</tr>
			<?php
			}
			?>
			<tr align='left'>
				<td colspan='2'>
					Email Address:<br /> 
					<input type='text' name='txtUserName' size="40" maxlength="100" value='<?php echo $txtUserName?>' />
				</td>
			
			</tr>
			<tr align='left'>
				<td>Password:<br /> 
					<input type='password' name='txtPassword' size='10' maxlength='10' value='<?php echo $txtPassword?>' />
				</td>
				<td>
					<input type='image' name='cmdLogin' src='./images<?php echo SITE_SUFFIX ?>/login.gif' alt='login' />
				</td>
			</tr>
		</table> 
		</form>
	</td>
</tr>


<tr valign='top' align='left'>
	<td>	
		<?php
		print(StartForm($strScreenName, "post", "actResetPassword","","","","frmResetPassword","","return frmResetPassword_onsubmit()"));
		?>
		<table width='100%' class='Normal' border='0'>
			<tr>
				<td colspan='2'>
					<hr />
					<b>Password Reset</b>
					<p>If you have forgotten your password please enter your Email address below. A new password will be 
					sent to you via Email.</p>
					Email Address: 
					
				</td>
			
			</tr>
			<tr>
				<td>
					<input type='text' name='txtUserName' size="40" maxlength="100" value='<?php echo $txtUserName?>' />
				</td>
				<td>
					<input type='image' src='./images<?php echo SITE_SUFFIX ?>/resetpassword.gif' alt='Reset Password' />
				</td>
			</tr>
		</table><?="		
		</form>"?>  
	</td>
</tr>
<?php
	if($strStyleSheet == TRUE){
   		echo "</table></div>";
	}

?>

<script language="javascript1.2" type="text/javascript">

<!--
function frmLogin_onsubmit() 
{

	 
	 if(document.frmLogin.txtUserName.value == "") {
         alert("Please enter user name.");
         document.frmLogin.txtUserName.focus();
         document.frmLogin.txtUserName.select();
         return(false);
     }
	 
	 
	 if(document.frmLogin.txtPassword.value == "") {
         alert("Please enter password.");
         document.frmLogin.txtPassword.focus();
         document.frmLogin.txtPassword.select();
         return(false);
     }


}

function frmResetPassword_onsubmit() 
{
	 
	 if(document.frmResetPassword.txtUserName.value == "") {
         alert("Please enter user name to reset.");
         document.frmResetPassword.txtUserName.focus();
         document.frmResetPassword.txtUserName.select();
         return(false);
     }


}
// -->
</script>

